function debounce(fn,delay){
    let timer
    return function(){
        timer?clearTimeout(timer):null
        timer=setTimeout(()=>{
            fn.apply(this,arguments)
        },delay)
    }
}
function thorttle(fn,duration){
    let start=0,now=Date.now()
    return function(){
        if(now-start>duration){
            start=now
            fn.apply(this,arguments)
        }
    }
}